asp问题~~~`看看下面的代码有问题吗?

来源:百度知道 编辑:UC知道 时间:2024/05/12 10:55:01
<table width="280" border="1" cellspacing="0" cellpadding="0">
<%for i=1 to 2%><tr>
<%for j=1 to 17%><td><%set rs=server.CreateObject("adodb.recordset")
sql="select * from buy where x='"&j&"' and y='"&i&"'"
rs.open sql,conn,3,2
if not rs.eof or rs.bof then
%><a href="buy.asp?x=<%=j%>&y=<%=i%>&title=福龙园A区1"><span class="STYLE5">●</span></a>
<%else%>
<%response.Write(rs("title"))%>
<%end if
rs.close%></td><%next%>
</tr><%next%>
</table>

有问题,应该是
<table width="280" border="1" cellspacing="0" cellpadding="0">
<%for i=1 to 2%><tr>
<%for j=1 to 17%><td><%set rs=server.CreateObject("adodb.recordset")
sql="select * from buy where x='"&j&"' and y='"&i&"'"
rs.open sql,conn,3,2
if not rs.eof or rs.bof then
%><a href="buy.asp?x=<%=j%>&y=<%=i%>&title=福龙园A区1"><span class="STYLE5">●</span></a>
<%else%>
<%response.Write("没有记录")%>
<%end if
rs.close%></td><%next%>
</tr><%next%>
</table>